package com.jiruan.invoicemanagementsystem.service.imp;

import com.jiruan.invoicemanagementsystem.dao.IAddressDao;
import com.jiruan.invoicemanagementsystem.dao.Imp.IAddressDaoImp;
import com.jiruan.invoicemanagementsystem.pojo.Address;
import com.jiruan.invoicemanagementsystem.pojo.Email;
import com.jiruan.invoicemanagementsystem.service.IAddressService;
import com.jiruan.invoicemanagementsystem.util.PageHelper;

import java.util.ArrayList;

public class IAddressServiceImp implements IAddressService {



    IAddressDao iad=new IAddressDaoImp();


    //添加新的地址信息
    /*
     * 1.详细地址
     * 2.省市区
     * 3.联系电话
     * 4.是否默认
     * (注意：默认地址只有一个，当一个地址被设置成默认时，原来的默认地址要取消默认状态。)
     * 5.收件人
     * */

    public boolean addNewAddress(Address address){
        return false;
    };


    public Integer updateAddressById(Address address){
        return iad.updateEmailAddressById(address);
    }


    //设置默认地址
    public Integer setDefaultAddress(Address address){
     return iad.updateAddressById(address);
    }




    //查询所有地址信息 - (全查)
    public ArrayList<Address> queryAllAddress(){
        return iad.selectAllAddress();

    }



    //分页获得邮箱地址
    public ArrayList<Address> queryAddress(PageHelper pageHelper){
        return iad.selectPageAllAddress(pageHelper);
    }

    //获得所有邮箱条数
    public int queryAddressCount(){

        return iad.queryAddressCount();
    }


}
